<!DOCTYPE html>
<html lang="zh">

<head>
    <meta charset="UTF-8">
    <title>js中的点击事件（click）的实现方式</title>
</head>

<body>
    <button id="btn">点我</button>
    <script type="text/javascript">
        var btn = document.getElementById("btn");
        btn.addEventListener('click', function () {
            alert("通过addEventListener监听事件");
        })
    </script>
</body>

</html>